<template>
    <div class="container">
        <el-page-header @back="goBack" content="用户反馈"></el-page-header>
        <div class="e-m-t-45">
            <div class="flex" style="justify-content:flex-end">
                <el-form :inline="true" class="demo-form-inline e-m-l-80">
                    <el-form-item label="关键词搜索">
                        <el-input placeholder="" prefix-icon="el-icon-search" v-model="key" clearable @change="getList">
                        </el-input>
                    </el-form-item>
                    <el-form-item label="反馈时间">
                        <el-date-picker @change="time" :clearable="false" value-format="yyyy-MM-dd" v-model="value1"
                            type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="getList">查询</el-button>
                    </el-form-item>
                    <el-form-item>

                    </el-form-item>
                </el-form>
            </div>
        </div>
        <div class="e-m-t-45">
            <el-table :data="tableData" stripe style="width: 100%">
                <el-table-column fixed type="index" label="序号" width="50">
                </el-table-column>
                <el-table-column type="expand"  prop="id" label="">
                    <template slot-scope="props">
                        <el-form label-position="left" inline class="demo-table-expand">
                            <el-form-item label="反聩内容：">
                                <span>{{ props.row.remarks }}</span>
                            </el-form-item>
                        </el-form>
                    </template>
                </el-table-column>
                <el-table-column prop="number" label="订单编号" width="200">
                    <template slot-scope="scope">
                        <span @click="getvieword(scope.row)">{{ scope.row.number }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="username" label="用户">
                    <template slot-scope="scope">
                        <span @click="getviewuse(scope.row)">{{ scope.row.username }}</span>
                    </template>
                </el-table-column>
                <el-table-column  prop="mobile" label="联系电话">
                </el-table-column>
                <el-table-column prop="usertype" label="用户类型">
                </el-table-column>
                <el-table-column prop="commenttime" label="反聩时间">
                </el-table-column>
                <el-table-column prop="remarks" label="反聩内容">
                </el-table-column>
            </el-table>
        </div>
        <div class="table-pagination">
            <el-pagination background layout="sizes, total, prev, pager, next" :total="total"
                :page-sizes="[10, 50, 100, 200]" :page-size="pageSize" :current-page="page" @current-change="pageChange"
                @size-change="handleSizeChange">
            </el-pagination>
        </div>
    </div>
</template>

<script>
export default {
    layout: 'admin',
    head() {
        return {
            title: '用户反馈' 
        }
    },
    components: {},
    props: {},
    data() {
        return {
            value1: '',
            key: '',
            page: 1,
            pageSize: 10,
            total: 0,
            tableData: '',
            starttime: "",
            endtime: "",
        };
    },
    watch: {},
    computed: {},
    methods: {
        goBack() {
            this.$router.go(-1)
        },
        getviewuse(row) {
            this.$router.push(`/user/views?id=${row.userid}`)
        },
        getvieword(row) {
            this.$router.push(`/order/user/Views?id=${row.orderid}`)
        },
        pageChange(e) { // 页码切换事件
            this.page = e;
            this.getList()
        },
        handleSizeChange(val) {
            this.page = 1;
            this.pageSize = val;
            this.getList()
        },
        getList() {
            this.$axios.post('/User/Order/CommentsList', {
                "PageIndex": this.page,
                "PageSize": this.pageSize,
                "Key": this.key
            }).then(res => {
                // this.tableData = res.rows
                // this.loading = false
                this.tableData = res.rows;
                this.total = res.total;
                console.log(res)
            })
        },
        time(e) {
            console.log(e)
            this.starttime = e[0]
            this.endtime = e[1]
            // this.timeType = 4

        },
    },
    mounted() {
        this.getList()
     }
};
</script>
<style lang="scss" scoped></style>